/*
 * Copyright (c) 2020, 2023, keyila All rights reserved.
 *
 */
package com.clp.study.designPattern.factoryPattern.easy;

/**
 * @author clp
 * @version 1.0
 */
public class ShapeFactory {
    //使用 getShape方法获取性状类型的对象
    public Shape getShape(String shapeType){
        if (shapeType==null){
            return null;
        }
        if (shapeType.equalsIgnoreCase("CIRCLE")){
            return new Circle();
        }else if (shapeType.equalsIgnoreCase("RECTANGLE")){
            return new Rectangle();
        }else if (shapeType.equalsIgnoreCase("SQUARE")){
            return new Square();
        }
        return null;
    }
}
